3.164 \(\int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n (A+B \tan (e+f x)+C \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=376 \[ -\frac {(B+i (A-C)) (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} F_1\left (m+1;-n,1;m+2;-\frac {d (a+b \tan (e+f x))}{b c-a d},\frac {a+b \tan (e+f x)}{a-i b}\right )}{2 f (m+1) (a-i b)}-\frac {(A+i B-C) (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} F_1\left (m+1;-n,1;m+2;-\frac {d (a+b \tan (e+f x))}{b c-a d},\frac {a+b \tan (e+f x)}{a+i b}\right )}{2 f (m+1) (-b+i a)}+\frac {C (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} \, _2F_1\left (m+1,-n;m+2;-\frac {d (a+b \tan (e+f x))}{b c-a d}\right )}{b f (m+1)} \]

[Out]

-1/2*(B+I*(A-C))*AppellF1(1+m,1,-n,2+m,(a+b*tan(f*x+e))/(a-I*b),-d*(a+b*tan(f*x+e))/(-a*d+b*c))*(a+b*tan(f*x+e
))^(1+m)*(c+d*tan(f*x+e))^n/(a-I*b)/f/(1+m)/((b*(c+d*tan(f*x+e))/(-a*d+b*c))^n)-1/2*(A+I*B-C)*AppellF1(1+m,1,-
n,2+m,(a+b*tan(f*x+e))/(a+I*b),-d*(a+b*tan(f*x+e))/(-a*d+b*c))*(a+b*tan(f*x+e))^(1+m)*(c+d*tan(f*x+e))^n/(I*a-
b)/f/(1+m)/((b*(c+d*tan(f*x+e))/(-a*d+b*c))^n)+C*hypergeom([-n, 1+m],[2+m],-d*(a+b*tan(f*x+e))/(-a*d+b*c))*(a+
b*tan(f*x+e))^(1+m)*(c+d*tan(f*x+e))^n/b/f/(1+m)/((b*(c+d*tan(f*x+e))/(-a*d+b*c))^n)

________________________________________________________________________________________

Rubi [A]  time = 0.90, antiderivative size = 376, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, integrand size = 45, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3655, 6725, 70, 69, 137, 136} \[ -\frac {(B+i (A-C)) (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} F_1\left (m+1;-n,1;m+2;-\frac {d (a+b \tan (e+f x))}{b c-a d},\frac {a+b \tan (e+f x)}{a-i b}\right )}{2 f (m+1) (a-i b)}-\frac {(A+i B-C) (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} F_1\left (m+1;-n,1;m+2;-\frac {d (a+b \tan (e+f x))}{b c-a d},\frac {a+b \tan (e+f x)}{a+i b}\right )}{2 f (m+1) (-b+i a)}+\frac {C (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} \, _2F_1\left (m+1,-n;m+2;-\frac {d (a+b \tan (e+f x))}{b c-a d}\right )}{b f (m+1)} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^n*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

-((B + I*(A - C))*AppellF1[1 + m, -n, 1, 2 + m, -((d*(a + b*Tan[e + f*x]))/(b*c - a*d)), (a + b*Tan[e + f*x])/
(a - I*b)]*(a + b*Tan[e + f*x])^(1 + m)*(c + d*Tan[e + f*x])^n)/(2*(a - I*b)*f*(1 + m)*((b*(c + d*Tan[e + f*x]
))/(b*c - a*d))^n) - ((A + I*B - C)*AppellF1[1 + m, -n, 1, 2 + m, -((d*(a + b*Tan[e + f*x]))/(b*c - a*d)), (a
+ b*Tan[e + f*x])/(a + I*b)]*(a + b*Tan[e + f*x])^(1 + m)*(c + d*Tan[e + f*x])^n)/(2*(I*a - b)*f*(1 + m)*((b*(
c + d*Tan[e + f*x]))/(b*c - a*d))^n) + (C*Hypergeometric2F1[1 + m, -n, 2 + m, -((d*(a + b*Tan[e + f*x]))/(b*c
- a*d))]*(a + b*Tan[e + f*x])^(1 + m)*(c + d*Tan[e + f*x])^n)/(b*f*(1 + m)*((b*(c + d*Tan[e + f*x]))/(b*c - a*
d))^n)

Rule 69

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*Hypergeometric2F1[
-n, m + 1, m + 2, -((d*(a + b*x))/(b*c - a*d))])/(b*(m + 1)*(b/(b*c - a*d))^n), x] /; FreeQ[{a, b, c, d, m, n}
, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] ||  !(Ra
tionalQ[n] && GtQ[-(d/(b*c - a*d)), 0]))

Rule 70

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Dist[(c + d*x)^FracPart[n]/((b/(b*c - a*d)
)^IntPart[n]*((b*(c + d*x))/(b*c - a*d))^FracPart[n]), Int[(a + b*x)^m*Simp[(b*c)/(b*c - a*d) + (b*d*x)/(b*c -
 a*d), x]^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] &&
(RationalQ[m] ||  !SimplerQ[n + 1, m + 1])

Rule 136

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[((b*e - a*
f)^p*(a + b*x)^(m + 1)*AppellF1[m + 1, -n, -p, m + 2, -((d*(a + b*x))/(b*c - a*d)), -((f*(a + b*x))/(b*e - a*f
))])/(b^(p + 1)*(m + 1)*(b/(b*c - a*d))^n), x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] &&  !IntegerQ[m] &&  !Int
egerQ[n] && IntegerQ[p] && GtQ[b/(b*c - a*d), 0] &&  !(GtQ[d/(d*a - c*b), 0] && SimplerQ[c + d*x, a + b*x])

Rule 137

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_), x_Symbol] :> Dist[(c + d*x)^
FracPart[n]/((b/(b*c - a*d))^IntPart[n]*((b*(c + d*x))/(b*c - a*d))^FracPart[n]), Int[(a + b*x)^m*((b*c)/(b*c
- a*d) + (b*d*x)/(b*c - a*d))^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] &&  !IntegerQ[m] &&
 !IntegerQ[n] && IntegerQ[p] &&  !GtQ[b/(b*c - a*d), 0] &&  !SimplerQ[c + d*x, a + b*x]

Rule 3655

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*t
an[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x
]}, Dist[ff/f, Subst[Int[((a + b*ff*x)^m*(c + d*ff*x)^n*(A + B*ff*x + C*ff^2*x^2))/(1 + ff^2*x^2), x], x, Tan[
e + f*x]/ff], x]] /; FreeQ[{a, b, c, d, e, f, A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] &&
NeQ[c^2 + d^2, 0]

Rule 6725

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

Rubi steps

\begin {align*} \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {(a+b x)^m (c+d x)^n \left (A+B x+C x^2\right )}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \left (C (a+b x)^m (c+d x)^n+\frac {(-B+i (A-C)) (a+b x)^m (c+d x)^n}{2 (i-x)}+\frac {(B+i (A-C)) (a+b x)^m (c+d x)^n}{2 (i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(-B+i (A-C)) \operatorname {Subst}\left (\int \frac {(a+b x)^m (c+d x)^n}{i-x} \, dx,x,\tan (e+f x)\right )}{2 f}+\frac {(B+i (A-C)) \operatorname {Subst}\left (\int \frac {(a+b x)^m (c+d x)^n}{i+x} \, dx,x,\tan (e+f x)\right )}{2 f}+\frac {C \operatorname {Subst}\left (\int (a+b x)^m (c+d x)^n \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\left ((-B+i (A-C)) (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}\right ) \operatorname {Subst}\left (\int \frac {(a+b x)^m \left (\frac {b c}{b c-a d}+\frac {b d x}{b c-a d}\right )^n}{i-x} \, dx,x,\tan (e+f x)\right )}{2 f}+\frac {\left ((B+i (A-C)) (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}\right ) \operatorname {Subst}\left (\int \frac {(a+b x)^m \left (\frac {b c}{b c-a d}+\frac {b d x}{b c-a d}\right )^n}{i+x} \, dx,x,\tan (e+f x)\right )}{2 f}+\frac {\left (C (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}\right ) \operatorname {Subst}\left (\int (a+b x)^m \left (\frac {b c}{b c-a d}+\frac {b d x}{b c-a d}\right )^n \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {(B+i (A-C)) F_1\left (1+m;-n,1;2+m;-\frac {d (a+b \tan (e+f x))}{b c-a d},\frac {a+b \tan (e+f x)}{a-i b}\right ) (a+b \tan (e+f x))^{1+m} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}}{2 (a-i b) f (1+m)}-\frac {(A+i B-C) F_1\left (1+m;-n,1;2+m;-\frac {d (a+b \tan (e+f x))}{b c-a d},\frac {a+b \tan (e+f x)}{a+i b}\right ) (a+b \tan (e+f x))^{1+m} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}}{2 (i a-b) f (1+m)}+\frac {C \, _2F_1\left (1+m,-n;2+m;-\frac {d (a+b \tan (e+f x))}{b c-a d}\right ) (a+b \tan (e+f x))^{1+m} (c+d \tan (e+f x))^n \left (\frac {b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}}{b f (1+m)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]  time = 25.50, size = 0, normalized size = 0.00 \[ \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^n*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

Integrate[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^n*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2), x]

________________________________________________________________________________________

fricas [F]  time = 1.70, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (C \tan \left (f x + e\right )^{2} + B \tan \left (f x + e\right ) + A\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{m} {\left (d \tan \left (f x + e\right ) + c\right )}^{n}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

integral((C*tan(f*x + e)^2 + B*tan(f*x + e) + A)*(b*tan(f*x + e) + a)^m*(d*tan(f*x + e) + c)^n, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (C \tan \left (f x + e\right )^{2} + B \tan \left (f x + e\right ) + A\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{m} {\left (d \tan \left (f x + e\right ) + c\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="giac")

[Out]

integrate((C*tan(f*x + e)^2 + B*tan(f*x + e) + A)*(b*tan(f*x + e) + a)^m*(d*tan(f*x + e) + c)^n, x)

________________________________________________________________________________________

maple [F]  time = 4.34, size = 0, normalized size = 0.00 \[ \int \left (a +b \tan \left (f x +e \right )\right )^{m} \left (c +d \tan \left (f x +e \right )\right )^{n} \left (A +B \tan \left (f x +e \right )+C \left (\tan ^{2}\left (f x +e \right )\right )\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x)

[Out]

int((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (C \tan \left (f x + e\right )^{2} + B \tan \left (f x + e\right ) + A\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{m} {\left (d \tan \left (f x + e\right ) + c\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^m*(c+d*tan(f*x+e))^n*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

integrate((C*tan(f*x + e)^2 + B*tan(f*x + e) + A)*(b*tan(f*x + e) + a)^m*(d*tan(f*x + e) + c)^n, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int {\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^m\,{\left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n\,\left (C\,{\mathrm {tan}\left (e+f\,x\right )}^2+B\,\mathrm {tan}\left (e+f\,x\right )+A\right ) \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(e + f*x))^m*(c + d*tan(e + f*x))^n*(A + B*tan(e + f*x) + C*tan(e + f*x)^2),x)

[Out]

int((a + b*tan(e + f*x))^m*(c + d*tan(e + f*x))^n*(A + B*tan(e + f*x) + C*tan(e + f*x)^2), x)

________________________________________________________________________________________

sympy [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: HeuristicGCDFailed} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))**m*(c+d*tan(f*x+e))**n*(A+B*tan(f*x+e)+C*tan(f*x+e)**2),x)

[Out]

Exception raised: HeuristicGCDFailed

________________________________________________________________________________________